home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 018a / zip2zi31.zip / ZIP2ZIPB.BAT < prev    next >
DOS Batch File  |  1993-05-31  |  3KB  |  104 lines

  1. @Echo off
  2. Rem Zip2zipB.Bat (Called by Zip2zip.Bat)
  3. Rem %1 is STARTING sub dir; D:\SubDir\ With trailing "\"
  4. Rem %2 is DRV:\Path\FileName.Zip furnished by ZIP2ZIP.BAT's Call ZIP2ZIPB %1 %%f
  5. Rem              ..Add/Change -options for Strip/Add Comment File, Logo etc.
  6.  
  7.  
  8.    Call ZIP2-SDE.BAT %1 Z_B
  9.       IF     "%FSIZE%"==""      GoTo MajorError
  10.       IF NOT "%FSIZE%"=="0"     GoTo REQ_SD
  11.  
  12. Echo    Zip2ZipB Executing..Working on %2
  13.  
  14.    Set CNZL=
  15.    Set FSIZE=
  16.  
  17.    PKUNZIP %2 -t >Nul
  18.    IF Errorlevel 1 GoTo Error
  19.    PKUNZIP %2 -v   | Find "{{Processed By ZIP2ZIP For Max Compression}}" >ZIP2-FSZ.
  20.    Call ZIP2-FSZ.BAT
  21.    IF "%FSIZE%"==""             GoTo MajorError
  22.     IF "%FSIZE%"=="0"           GoTo CHK_PTH
  23.       Echo  %2 Has Been Processed Before With ZIP2ZIP, Skipping.
  24.       Echo  %2 Has Been Processed Before With ZIP2ZIP, Skipping. >>%1ZIP2ZIP.LOG
  25.       GoTo End
  26.  
  27. :CHK_PTH
  28.    Call ZIP2-ZNP.BAT %2
  29.    IF "%FSIZE%"==""             GoTo MajorError
  30.     IF "%FSIZE%"=="0"           GoTo UN_ZIP
  31.       Echo  %2 FAILED  Contains a .ZIP File In It's Path. (B) >>%1ZIP2ZIP.LOG
  32.       Echo  %2 Failed. See ZIP2ZIP.LOG
  33.       GoTo End
  34.  
  35. :UN_ZIP
  36.    PKunZip  %2  -d -Jhrs %1Z_B
  37.      IF Errorlevel 1            GoTo Error
  38.       IF NoT Exist %1Z_B\*.ZIP  GoTo RE_ZIP
  39.  
  40. Rem ==========================================================
  41.    DIR %1Z_B\*.ZIP | Find /C " ZIP " >#2DO_B.
  42.    For %%f in ( %1Z_B\*.ZIP ) DO Call ZIP2ZIPC.BAT %1 %%f
  43. Rem ==========================================================
  44.  
  45.   IF "%SAFETY%"=="" GoTo End
  46.    IF Not Exist %1Z_B\CNZL.FLG  GoTo RE_ZIP
  47.      SET CNZL=Y
  48.      Echo  %2 FAILED.. Look For Lower Reason >>%1ZIP2ZIP.LOG
  49.      GoTo Done
  50.  
  51. :RE_ZIP
  52.    PKZip %2  -k -mrp -ex -Jhrs -wHS  %1Z_B\*.*
  53.    IF Errorlevel 1 GoTo Error
  54.    Echo {{Processed By ZIP2ZIP For Max Compression}} | PKZIP %2 -k -ex -z
  55.    IF Errorlevel 1 GoTo Error
  56.  
  57. GoTo Skip_Alt_Method
  58. Rem Alt_Method....Edit To Suit
  59. Rem BBS could put their Comment "Add" here. And Change FIND Search Spec above.
  60. :: Echo {{Processed By ZIP2ZIP For Max Compression}} >TMP.CMT
  61. :: PKZip %2 -k -ex -z  <TMP.CMT   ...or your BBS comment.txt file
  62. :: Del TMP.CMT >Nul
  63. :Skip_Alt_Method
  64.  
  65.    Echo %2   OK >>%1ZIP2ZIP.LOG
  66.    Echo %2>>%1ZIP2ZIP.CVT
  67.    GoTo Done
  68.  
  69. :MajorError
  70.    Echo Major Logic Error. Do NOT Continue.
  71.    Set   CNZL=Y
  72.    Echo %CNZL%  >%1Z_B\CNZL.FLG
  73.    IF "%Safety%"=="" GoTo End
  74.    Echo Cancel With ^C (Control C)...Or...
  75. Rem Sysops will want to Comment out the Pauses
  76.    Pause
  77.    Set Safety=
  78.    GoTo End
  79.  
  80. :REQ_SD
  81.    Echo Reserved Sub Dir %1Z_B Exists. A prior execution failed to delete it.
  82.    Echo This could be a malfunction of the ATTRIB.EXE  /S Cmd or something
  83.    Echo more serious.  This Sub Dir Must NOT Exist At This Point...Canceling
  84.    Echo.
  85.    IF "%Safety%"=="" GoTo End
  86.    Echo Cancel With ^C (Control C)...Or...To Skip The Rest...
  87.    Pause
  88.    Set Safety=
  89.    GoTo End
  90.  
  91. :Error
  92.    Echo  %2 Failed.. PKZIP or PKUNZIP Encountered an Error in 1st Lev.>>%1ZIP2ZIP.LOG
  93.    Set   CNZL=Y
  94.    Echo %CNZL% >%1Z_B\CNZL.FLG
  95.  
  96. :Done
  97.    Call ZIP2ZMOP.BAT %1  Z_B  Z_B  %CNZL%
  98.  
  99. :End
  100.    For %%f IN (#2DO_B. #DONE_B. #AT_B.) DO IF Exist %%f Del %%f >Nul
  101.    For %%f IN (#2DO_C. #DONE_C. #AT_C.) DO IF Exist %%f Del %%f >Nul
  102.    Set DONE_B=
  103.    Set DONE_C=
  104.